home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Whitby AMOS Club
/
Whitby AMOS Club 1.adf
/
TEXT
/
BEGINNERS
< prev
next >
Wrap
Text File
|
1978-01-29
|
4KB
|
91 lines
Whitby Amos Club Beginners Section
----------------------------------
Welcome to the very first programming tutorial for beginners
brought to you by the Whitby Amos Club. So come on and settle
back and enjoy the exciting world of AMOS basic.
First of all, congratulations for buying one of the greatest
programming tools available for the Amiga. Amos's principle is
to let you access the Amigas hardware and technical wizardry
quickly and easily without having to wade through assembler.
Well lets not bother with assembler shall we. lets
concentrate on AMOS and programming in general. A computer
program is simply a collection of instructions telling a
computer what to do. We can store our programs on disk, or if
were lucky a hard drive. We can use a keyboard to 'INPUT' our
programs our we can 'LOAD' them from disk.
Lets start with our first program shall we.
Load up your copy of AMOS. When it is loaded press any key to
get rid of the intro menu. You are now into the editor. This
is where you will enter most of your programs.
now enter the following:
PRINT "HELLO READER"
TO GET ", PRESS SHIFT+2
All this simple program does is prints what ever you place
inside the two dots or quotation marks. So on the screen will
be displayed "HELLO READER". You can place numbers as well as
letters inside your quotes. Your not restricted. If you want to
do a simple maths program that adds to numbers together then
why not try this program for size.
INPUT "ENTER YOUR FIRST NUMBER",NONE
INPUT "ENTER YOUR SECOND NUMBER",NTWO
LET THREE=NONE+NTWO
PRINT NONE+NTWO=THREE
In this program we introduce the talents of 'VARIABLES'.
Variables are simply places inside a computers memory that you
can store data. For example: In our program we use a variable
called 'NONE'. All this tells the computer to do is store your
replay to the question been asked by the program. Let say you
answered 15 for the first question, then the number 15 would be
placed inside the computers memory under the address 'NONE'.
Just think of computer memory addresses as real home addresses.
Its somewhere for them to live. The same principle applies for
the second question. Again, the answer you give is stored in an
address called 'NTWO'. Finally the last statement adds the two
numbers together to give you your answer. So if you entered 15
for the first question and 15 for the second then 30 would be
displayed as our program suggests. Have you noticed that i
have not used quotations for the last statement in our program?
That is we don't need to use quotation marks if we are adding two
variables together. Going back to the program i almost forgot
to tell you about the word 'INPUT'. As the word suggests, you
simply 'INPUT' or enter the required response. I thought you
may have gathered that but, just in case, i thought i'd mention
it. That covers adding numbers together. lets add two 'STRING
VARIABLES' together shall we.
String variables are simply a string that enables you to store
text. eg:
A$="WHITBY AMOS CLUB"
So basically we have asked the computer to store our text into a
memory address called 'A$'. The address rule applies as above
except this time we have asked the computer to store a pre-set
response. Being 'WHITBY AMOS CLUB' into our address storage.
We have also used a '$' this time as our 'variable' name. This
tells the Amiga that we would like to store text into its
memory. You don't need the '$' if you want to store numbers.
For a bit of a fun exercise, why not write a program that will ask
a user for the following and display them on the screen in a nice
address book fashion:
NAME, ADDRESS,AGE,TELEPHONE NUMBER
Next time i will display a solution to the above question.
In the coming issues i will show you how to program your very
own database. It not as hard as it sounds. All the examples
above are contained on the disk so you can see for yourselves.
Sadly thats it for this issue. So hope to see you next issue.
So until then, happy AMOSing.
(PAUL GUMSLEY)